<template>
  <div>
    弹窗
    <div>{{ yun }}</div>
    <button @click="butt">转换数据点击</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      yun: '要发送的数据'
    }
  },
  methods: {
    cuanson() {
      this.$emit('xfqyyds', this.yun)
      console.log(this.yun)
    },
    butt() {
      const sisui = [
        {
          name: '四岁',
          id: 1
        },
        {
          name: '五sdfsf岁',
          id: 2
        },
        {
          name: '六cxv岁',
          id: 1
        },
        {
          name: '七aed2岁',
          id: 2
        }
      ]
      console.log(sisui.reduce((ele, inst) => `${ele}${inst.name}`, ','))
      const xfq = sisui.reduce((p, n) => { return p + n.name }, '')
      console.log(xfq)
      const resr = sisui.map(ele => {
        return ele.name
      })
      console.log(resr.join())
    }
  }
}
</script>

<style>

</style>
